﻿///***************************************************************
/// 시  스  템 : Updms.Usr.Dac
/// 단위시스템 : USR
/// 계      층 : Data Access Layer
/// 프로그램명 : Usr_Dac_UPDMS_USR_TODO
/// 파  일  명 : Usr_Dac_UPDMS_USR_TODO.cs
/// 설      명 : TODO
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2011-11-16 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Usr.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Usr_Dac_UPDMS_USR_TODO : Base.AppFramework.DacBase
	{
		public Usr_Dac_UPDMS_USR_TODO()
		{
		}

		#region NT [GetSearchCount]

		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_USR_TODO_Get_Search_Count";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_USR_TODO_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(strSql, "UPDMS_USR_TODO", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [GetToDoCount]
		/// <summary>
		/// 사용자별 TO-DO 카운트 조회
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public int GetToDoCount(string ls_user_id)
		{
			string strSql = "usp_UPDMS_USR_TODO_Get_TODO_Count";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_user_id", ls_user_id)
			};

			return (int)_agent.ExecuteScalar(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion


		#region RT [CreateTodoByMonthly]

		[AutoComplete]
		public int CreateTodoByMonthly(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_USR_TODO_Create_Todo_By_Monthly";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string strSql = "usp_UPDMS_USR_TODO_Update";			
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion
	}
}
